3-Create Post.bruā¢908 B
meta {
name: Create Post
type: http
seq: 3
}
post {
url: {{baseUrl}}/posts
body: json
auth: none
}
headers {
Content-Type: application/json
Accept: application/json
}
body:json {
{
"title": "My New Post",
"body": "This is the content of my new post created via Bruno MCP Server",
"userId": 1
}
}
tests {
test("Status should be 201", function() {
expect(res.status).to.equal(201);
});
test("Response should be JSON", function() {
expect(res.headers['content-type']).to.include('application/json');
});
test("Response should have an ID", function() {
expect(res.body.id).to.be.a('number');
});
test("Title should match", function() {
expect(res.body.title).to.equal("My New Post");
});
test("Body should match", function() {
expect(res.body.body).to.equal("This is the content of my new post created via Bruno MCP Server");
});
}